#include "boneManager.h"

boneManager* boneManager::_instance = 0;

boneManager* boneManager::Instance()
{
	if (_instance == NULL)
	{
		_instance = new boneManager();
	}
	return _instance;
}

boneManager::boneManager()
{

}

void boneManager::add(Bone* b)
{
	manager.push_back(b);
}

void boneManager::updata()
{
	for (vector<Bone*>::iterator itor = manager.begin();
		itor != manager.end();)
	{
		if ((*itor)->checkRemove())
		{
			delete *itor;
			itor = manager.erase(itor);
		}else
		{
			(*itor)->updata();
			itor++;
		}
	}
}